#include<iostream>
#include<algorithm>

using namespace std;
using LL = long long;
const int N = 1e5 + 10;

int n, m, k;
int q[N];

bool col(){
    LL sum = 0;
    int maxl = 0;
    for (int i = 1; i <= k; i ++){
        int t = q[i] / n;
        if(t >= 2){
            sum = (LL)sum + t;
            maxl = max(maxl, t);
        }
    }

    if(m == 3){
        return maxl >= 3;
    }else{
        if(m % 2 == 0){
            return sum >= m;
        }else{
            return sum >= m && maxl >= 3;
        }
    }
}

bool row(){
    LL sum = 0;
    int maxr = 0;

    for (int i = 1; i <= k; i ++){
        int t = q[i] / m;
        if(t >= 2){
            sum = (LL)sum + t;
            maxr = max(maxr, t);
        }
    }

    if(n == 3){
        return maxr >= 3;
    }else{
        if(n % 2 == 0){
            return sum >= n;
        }else{
            return sum >= n && maxr >= 3;
        }
    }
}



int main(){


    int T;
    scanf("%d", &T);
    while(T--){
        scanf("%d%d%d", &n, &m, &k);
        for (int i = 1; i <= k; i ++){
            scanf("%d", &q[i]);
        }

        bool find = (row() || col());
        if(find){
            printf("Yes\n");
        }else{
            printf("No\n");
        }
    }

    return 0;
}